using System.Data;
using Dapper;
using KL.Standard.Model.Infrastructure;

namespace KL.Standard.Repositories;

public interface IRepository<T> : IDisposable where T : class
{
    long Save(T obj, IDbTransaction trans = null);
    T Get(long id);

    long Insert(T obj, IDbTransaction trans = null);

    bool Delete(T obj, IDbTransaction trans = null);

    bool Update(T obj, IDbTransaction trans = null);

    string GetIP();

    string GetID();

    

    Task<PageResult<TP>> PagerAsync<TP>(string sql, DynamicParameters param, PageSearchModel search);
}